const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_enterprise_join_project_log', {
    id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "主键"
    },
    corpName: {
      type: DataTypes.STRING(200),
      allowNull: true,
      comment: "单位名称",
      field: 'corp_name'
    },
    corpCode: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "单位组织机构代码",
      field: 'corp_code'
    },
    corpBoss: {
      type: DataTypes.STRING(200),
      allowNull: true,
      comment: "单位项目负责人",
      field: 'corp_boss'
    },
    safetyCerId: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "安全生产许可证编号",
      field: 'safety_cer_id'
    },
    constructor: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "负责人"
    },
    constructorIdCardTypeNum: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "负责人身份证类型代码",
      field: 'constructor_id_card_type_num'
    },
    constructorIdCard: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "负责人身份证号",
      field: 'constructor_id_card'
    },
    corpAddress: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "单位地址",
      field: 'corp_address'
    },
    legalMan: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "法定代表人",
      field: 'legal_man'
    },
    legalManIdCard: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "法定代表人身份证",
      field: 'legal_man_id_card'
    },
    legalManTel: {
      type: DataTypes.STRING(32),
      allowNull: true,
      comment: "联系方式",
      field: 'legal_man_tel'
    },
    buildeSpecialtyType: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "执业资格（职称）",
      field: 'builde_specialty_type'
    },
    certNum: {
      type: DataTypes.STRING(64),
      allowNull: true,
      comment: "执业资格编号（职称）",
      field: 'cert_num'
    },
    telNum: {
      type: DataTypes.STRING(18),
      allowNull: true,
      comment: "单位联系电话",
      field: 'tel_num'
    },
    isDeleted: {
      type: DataTypes.TINYINT,
      allowNull: true,
      comment: "是否删除",
      field: 'is_deleted'
    },
    createdUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'created_user'
    },
    createdTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "本系统创建时间",
      field: 'created_time'
    },
    updatedUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'updated_user'
    },
    updatedTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'updated_time'
    }
  }, {
    sequelize,
    tableName: 'base_enterprise_join_project_log',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
